package com.wanxi.test;

import java.util.Scanner;

public class SumIsGreatHundred {
    public static void main(String[] args) {
        /**
         * 思路？
         *
         */
        int one = getNum("请输入第一季度的销量");
        int two = getNum("请输入第二季度的销量");
        int three = getNum("请输入第三季度的销量");
        int four = getNum("请输入第四季度的销量");
        int all = getNum("请输入优秀的标准");
//        int[] arr = {one, two, three, four};
        int sum = getSum(one, two, three, four);
        judge(sum, all);
    }

    private static void judge(int sum, int all) {
        if (sum > all) {
            System.out.println("业绩好");
        }

    }

//    private static int getSum(int one, int two) {
//        return one + two;
//    }

    /**
     *
     * @param arr
     * @return
     */
    private static int getSum(int... arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }

    /**
     *
     * @param tips
     * @return
     */
    private static int getNum(String tips) {
        Scanner scanner = new Scanner(System.in);
        System.out.println(tips);
        int num = scanner.nextInt();
        return num;
    }
}
